import { createI18n } from 'vue-i18n'
import messages from './index'
import store from '@/store'
const i18n = createI18n({
  legacy: false, //处理报错Uncaught (in promise) SyntaxError: Not available in legacy mode (at message-compiler.esm-bundler.js:54:19)
  locale: store.state.handle.ceSwitch || "zh", // 注意locale属性~~~~~~~~！
  messages: {
    'zh': messages.zh,
    'en': messages.en
  },
  globalInjection: true, // 加上这一句
})

export default i18n

